var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("NotifyEventType"),
    i = e("AssetsManager"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.fnt_atlas = []), (t.hit_label_pool = null), t;
        }
        return (
            __extends(t, e),
            (t.prototype.initView = function () {
                (this.hit_label_pool = new cc.NodePool()), this.initPool();
            }),
            (t.prototype.addEvent = function () {
                this.attachEvent(a.default.SEND_SHOW_BE_HIT_INFO, this.showBeHitInfo, this);
            }),
            (t.prototype.initPool = function () {
                for (var e = 0; e < 10; e++) {
                    var t = cc.instantiate(i.default.getInstance().getFightPrefab("be_hit_num"));
                    this.hit_label_pool.put(t);
                }
            }),
            (t.prototype.getPool = function () {
                return this.hit_label_pool.size() > 0
                    ? this.hit_label_pool.get()
                    : cc.instantiate(i.default.getInstance().getFightPrefab("be_hit_num"));
            }),
            (t.prototype.Recovey = function (e) {
                e.stopAllActions(), this.hit_label_pool.put(e);
            }),
            (t.prototype.showBeHitInfo = function (e, t) {
                var o = this,
                    n = t,
                    a = this.getPool();
                (a.getComponent(cc.Label).string = "" + Number(n.attack).toFixed()),
                    (a.getComponent(cc.Label).font = this.fnt_atlas[n.my_team]),
                    a.setPosition(n.end_pos),
                    (a.scale = 0.6),
                    cc
                        .tween(a)
                        .by(0.3, {position: cc.v3(0, 50, 0), scale: 1.4})
                        .by(0.3, {position: cc.v3(0, 20, 0), scale: -2})
                        .call(function () {
                            o.Recovey(a);
                        })
                        .start(),
                    this.node.addChild(a);
            }),
            __decorate([l(cc.LabelAtlas)], t.prototype, "fnt_atlas", void 0),
            __decorate([s], t)
        );
    })(n.default);
o.default = c;
